<html>
  <head>
  <title>minicontest.py</title>
  </head>
  <body>
  <h3>minicontest.py (<a href="../minicontest.py">original</a>)</h3>
  <hr>
  <pre>
<span style="color: green; font-style: italic"># minicontest.py
# --------------
# Licensing Information: Please do not distribute or publish solutions to this
# project. You are free to use and extend these projects for educational
# purposes. The Pacman AI projects were developed at UC Berkeley, primarily by
# John DeNero (denero@cs.berkeley.edu) and Dan Klein (klein@cs.berkeley.edu).
# For more info, see http://inst.eecs.berkeley.edu/~cs188/sp09/pacman.html

</span><span style="color: blue; font-weight: bold">import </span>util
<span style="color: blue; font-weight: bold">import </span>classificationMethod

<span style="color: blue; font-weight: bold">class </span>contestClassifier<span style="font-weight: bold">(</span>classificationMethod<span style="font-weight: bold">.</span>ClassificationMethod<span style="font-weight: bold">):
  </span><span style="color: darkred">"""
  Create any sort of classifier you want. You might copy over one of your
  existing classifiers and improve it.
  """
  </span><span style="color: blue; font-weight: bold">def </span>__init__<span style="font-weight: bold">(</span><span style="color: blue">self</span><span style="font-weight: bold">, </span>legalLabels<span style="font-weight: bold">):
    </span><span style="color: blue">self</span><span style="font-weight: bold">.</span>guess <span style="font-weight: bold">= </span><span style="color: blue">None
    self</span><span style="font-weight: bold">.</span>type <span style="font-weight: bold">= </span><span style="color: red">"minicontest"
  
  </span><span style="color: blue; font-weight: bold">def </span>train<span style="font-weight: bold">(</span><span style="color: blue">self</span><span style="font-weight: bold">, </span>data<span style="font-weight: bold">, </span>labels<span style="font-weight: bold">, </span>validationData<span style="font-weight: bold">, </span>validationLabels<span style="font-weight: bold">):
    </span><span style="color: darkred">"""
    Please describe your training procedure here.
    """
    </span><span style="color: red">"*** YOUR CODE HERE ***"
    </span>util<span style="font-weight: bold">.</span>raiseNotDefined<span style="font-weight: bold">()
  
  </span><span style="color: blue; font-weight: bold">def </span>classify<span style="font-weight: bold">(</span><span style="color: blue">self</span><span style="font-weight: bold">, </span>testData<span style="font-weight: bold">):
    </span><span style="color: darkred">"""
    Please describe how data is classified here.
    """
    </span><span style="color: red">"*** YOUR CODE HERE ***"
    </span>util<span style="font-weight: bold">.</span>raiseNotDefined<span style="font-weight: bold">()
</span>
  </pre>
  </body>
  </html>
  